/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.base.entity.customerdataconfig;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.modules.sys.entity.User;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;

/**
 * 客户资料附件信息配置表Entity
 * @author LV
 * @version 2021-02-26
 */
@Table(name="t_customer_dataconfig", alias="a", columns={
		@Column(name="datacon_id", attrName="dataconId", label="资料信息配置id", isPK=true),
		@Column(name="datacon_name", attrName="dataconName", label="资料信息名称", queryType=QueryType.LIKE),
		@Column(name="datacon_require", attrName="dataconRequire", label="资料信息是否必填"),
		@Column(includeEntity=DataEntity.class),
	},joinTable = {
        @JoinTable(type = JoinTable.Type.LEFT_JOIN, entity = User.class, attrName = "createByUser", alias = "createby",
                on = "createby.user_code = a.create_by", columns = {
                @Column(name = "user_code", label = "用户编码", isPK = true),
                @Column(name = "user_name", label = "用户名称", isQuery = false),
        }),
        @JoinTable(type = JoinTable.Type.LEFT_JOIN, entity = User.class, attrName = "updateByUser", alias = "updateby",
                on = "updateby.user_code = a.update_by", columns = {
                @Column(name = "user_code", label = "用户编码", isPK = true),
                @Column(name = "user_name", label = "用户名称", isQuery = false),
        }),
}, orderBy="a.update_date DESC"
)
public class CustomerDataconfig extends DataEntity<CustomerDataconfig> {
	
	private static final long serialVersionUID = 1L;
	private String dataconId;		// 资料信息配置id
	private String dataconName;		// 资料信息名称
	private String dataconRequire;		// 资料信息是否必填
    private User createByUser;
    private User updateByUser;
	
	public CustomerDataconfig() {
		this(null);
	}

	public CustomerDataconfig(String id){
		super(id);
	}
	
	public String getDataconId() {
		return dataconId;
	}

	public void setDataconId(String dataconId) {
		this.dataconId = dataconId;
	}
	
	@NotBlank(message="资料信息名称不能为空")
	@Length(min=0, max=100, message="资料信息名称长度不能超过 100 个字符")
	public String getDataconName() {
		return dataconName;
	}

	public void setDataconName(String dataconName) {
		this.dataconName = dataconName;
	}
	
	@NotBlank(message="资料信息是否必填不能为空")
	@Length(min=0, max=1, message="资料信息是否必填长度不能超过 1 个字符")
	public String getDataconRequire() {
		return dataconRequire;
	}

	public void setDataconRequire(String dataconRequire) {
		this.dataconRequire = dataconRequire;
	}

    public User getCreateByUser() {
        return createByUser;
    }

    public void setCreateByUser(User createByUser) {
        this.createByUser = createByUser;
    }

    public User getUpdateByUser() {
        return updateByUser;
    }

    public void setUpdateByUser(User updateByUser) {
        this.updateByUser = updateByUser;
    }
}